package com.zsy.springcloud.controller;

import com.zsy.springcloud.service.AccountService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Log4j2
@RestController
public class AccountConsumerController {

    @Resource
    private AccountService accountService;

    @RequestMapping(value = "/getAccount", method = RequestMethod.GET)
    public Map<String,Object> getAccount() {
        Map<String,Object> account = new HashMap<>();
        log.info("---------消费者开始------------");
        account = accountService.getAccount();
        log.info("---------消费者结束--------account{}----", account);
        return account;
    }
}
